<?php
/**
 * Created by PhpStorm.
 * Author: QinShuai
 * Email: qinshuai0423@qq.com
 * Date: 2021/6/23
 */

namespace backend\controllers;

use backend\behaviors\AdminAuthBehavior;
use backend\models\AdminRule;
use backend\traits\Controller;

class AdminRuleController extends BaseController
{
    use Controller;

    public function actionIndex()
    {
        $adminRuleModel = new AdminRule();
        $data = $adminRuleModel->getTreeData();
        $select = $adminRuleModel->getSelectData();
        $data = [
            'tableData' => json_encode($data),
            'select' => json_encode($select)
        ];
        if(\Yii::$app->request->isAjax){
            return $this->success($data);
        }
        return $this->render('index');
    }
}